import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Explore from '../views/Explore.vue'
import Upload from '../views/Upload.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/explore',
    name: 'Explore',
    component: Explore
  },
  {
    path: '/upload',
    name: 'Upload',
    component: Upload
  },
  {
    path: '/processDefinition',
    name: 'ProcessDefinition',
    component: () => import('../views/ProcessDefinition.vue')
  },
  {
    path: '/assetCategory',
    name: 'AssetCategory',
    component: () => import('../views/AssetCategory.vue')
  }
]

const router = new VueRouter({
  routes
})
// let a = 0
// router.beforeEach((to, from, next) => {
//   a++
//   if (a < 3) {
//     next({ path: '/about' })
//   } else {
//     next()
//   }
// })

export default router
